package com.cxb.publisher;

import lombok.RequiredArgsConstructor;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class MyApplicationPublisher implements ApplicationEventPublisherAware,MyProcessEventPublisher {

    private  ApplicationEventPublisher publisher;
    @Override
    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        this.publisher = applicationEventPublisher;
    }

    @Override
    public void publish(ApplicationEvent event) {
        publisher.publishEvent(event);
    }
}
